$("#conditionBtn").click(function () {
    dialog_show();
    $(".dialog").load("page/admin/condition");
    setTimeout(function () {
    }, 500);
})
var load_zhu_data = function (charDiv) {
    $.ajax({
        url: "dorm/analysis/tung",
        type: "post",
        data: {
            "token": localStorage['token'],
        },
        success: function (data) {
            console.log(data);
            if (data.code == 200) {
                var tungNum = [];
                var consume = [];
                for (var i = 0; i < data.data.length; i++) {
                    tungNum[i] = data.data[i].tungNum;
                    consume[i] = data.data[i].consume;
                    zhuChar(charDiv, tungNum, consume);
                }
            } else {
                errorMessage(data.msg);
            }
        }
    })

}
var zhuChar = function (charDiv, tungNum, consume) {
    option = {
        color: ['#3398DB'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: tungNum,
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '消耗电量',
                type: 'bar',
                barWidth: '60%',
                data: consume
}
]
}
    ;
    charDiv.setOption(option);
}